package com.example.backend.service;


import com.example.backend.entity.Car;
import com.example.backend.mapper.CarMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class CarService {

    @Autowired
    CarMapper carMapper;

    public int add(Car car) {
        return carMapper.insert(car);
    }

    public boolean delete(String car_num) {
        return carMapper.delete(car_num) > 0;
    }

    public boolean update(Car car) {
        return carMapper.update(car) > 0;
    }

    public Object queryAll(String car_num) {
        return carMapper.queryAll(car_num);
    }
    public int queryExist(Car car) {
        return carMapper.selectExist(car);
    }
    public int updateAdd(Car car) {
        return carMapper.updateAdd(car);
    }
    public int updateJian(Car car) {
        return carMapper.updateJian(car);
    }
    public ArrayList<Car> selectCars(Car car) {
        return carMapper.selectCars(car);
    }
    public int updateShopNum(Car car) {
        return carMapper.updateShopNum(car);
    }

}
